import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/home",
    component: HomeView,
    children: [
      {
        path: "index",
        component: () => import("../views/index/Index.vue"),
      },
      {
        path: "hospital",
        component: () => import("../views/to-hospital/Hospital.vue"),
      },
      {
        path: "health",
        component: () => import("../views/health/Health.vue"),
      },
      {
        path: "me",
        component: () => import("../views/me/Me.vue"),
      },
     
      {
        path: "xinxi",
        component: () => import("../views/me/Xinxi.vue"),
      },
      
      {
        path: "querenguahao/:id",
        name: "querenguahao",
        component: () => import("../views/guahao/querenguahao.vue"),
      },
      {
        path: "yishengxiangqing/:id",
        name: "yishengxiangqing",
        component: () => import("../views/guahao/yishengxiangqing.vue"),
      },
      {
        path: "yuyueguahao",
        name: "yuyueguahao",
        component: () => import("../views/guahao/yuyueguahao.vue"),
      },
    ],
  },
  {
    path: "/medicine/:id",
    name: "购物",
    
    component: () => import("../views/medicine/Medicine.vue"),
  },
  {
    path: "/medi-serch",
    name: "购物搜索",
    
    component: () => import("../views/medicine/MedicineSerch.vue"),
  },
  {
    path: "/shopping",
    name: "购买成功",
    component: () => import("../views/medicine/Shopping.vue"),
  },
  {
    path: "/card",
    name: "购物车",
    component: () => import("../views/medicine/card.vue"),
  },
  {
    path: "/Health-examination-subscribe",
    component: () =>
      import("../views/healthExamination/HealthExaminationSubscribe.vue"),
  },
  {
    path: "/hospital_Details/:id",
    name: "hospitalDetails",
    component: () =>
      import("../views/healthExamination/hospitalDetails.vue"),
  },
  {
    path: "/set_meal_details/:id",
    name: "SetMealDetails",
    component: () =>
      import("../views/healthExamination/SetMealDetails.vue"),
  },
  {
    path: "/yiyuankeshi/:id",
    name: "yiyuankeshi",
    component: () => import("../views/guahao/yiyuankeshi.vue"),
  },
  {
    path: "/hospital",
    name: "hospital",
    component: () => import("../views/to-hospital/Hospital.vue"),
  },
  {
    path: "/xinxi/:id",
    component: () => import("../views/me/Xinxi.vue"),
  },
  {
    path: "/consultation",
    name: "consultation",
    component: () => import("../views/consultation/Consultation.vue"),
  },
  {
    path: "/consulting/:doctor_id",
    name: "consulting",
    component: () => import("../views/consultation/Consulting.vue"),
  },
  {
    path: "/online/:d_id",
    name: "online",
    component: () => import("../views/consultation/Online.vue"),
  },
  {
    path: "/aiconsulting/:doctor_id",
    component: () => import("../views/consultation/AiConsulting.vue"),
  },
  {
    path: "/searchDoc",
    name: "searchDoc",
    component: () => import("../views/consultation/SearchDoc.vue"),
  },
  {
    path: "/login",
    component: () => import("../views/me/Login.vue"),
  },
  {
    path: "/zhuce",
    name: "zhuce",
    component: () => import("../views/me/zhuce.vue"),
  },
  {
    path: "/detail/:id",
    name: "detail",
    component: () => import("../views/health/HealthDetail.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
